import jwt3
from datetime import datetime, timezone

token = jwt3.encode({"exp": 1371720939}, "secret")
print(token)

token = jwt3.encode({"exp": datetime.now(tz=timezone.utc)}, "secret")
print(token)

try:
    jwt3.decode(token, "secret", algorithms=["HS256"])
except jwt3.ExpiredSignatureError:
    print("expired")